<template lang="html">
  <div class="tabbar-container">
    <as-header title="Tabbar">
      <router-link to="/" slot="left" class="link">
        <span class="iconfont icon-zuosanjiao"></span>
      </router-link>
    </as-header>
    <as-tab-container v-model="selectedTabId" class="tab-container">
      <as-tab-container-item tabId="tab1">tab1 内容</as-tab-container-item>
      <as-tab-container-item tabId="tab2">tab2 内容</as-tab-container-item>
      <as-tab-container-item tabId="tab3">tab3 内容</as-tab-container-item>
      <as-tab-container-item tabId="tab4">tab4 内容</as-tab-container-item>
    </as-tab-container>
    <br>
    <as-cell title="当前选中Tab" :value="selectedTabId"></as-cell>
    <as-tabbar v-model="selectedTabId" fixed>
      <as-tab-item tabId="tab1">
        <img slot="icon" class="icon">
        tab1
      </as-tab-item>
      <as-tab-item tabId="tab2">
        <img slot="icon" class="icon">
        tab2
      </as-tab-item>
      <as-tab-item tabId="tab3">
        <img slot="icon" class="icon">
        tab3
      </as-tab-item>
      <as-tab-item tabId="tab4">
        <img slot="icon" class="icon">
        tab4
      </as-tab-item>
    </as-tabbar>
  </div>
</template>

<script>
export default {
  name: 'Tabbar',
  data() {
    return {
      selectedTabId: 'tab1'
    }
  },
}
</script>

<style lang="scss">
.tabbar-container{
  position: relative;

  .link {
    display: flex;
    align-items: center;
  }
  .title {
    color: yellow;
  }
  .icon {
    width: 64px;
    height: 64px;
    border: 1px solid #666; /* no */
    box-sizing: border-box;
  }
  .active {
    background-color: #dddddd;
  }
  .tab-container {
    margin-top: 20px;
    padding: 20px;
    height: 500px;
    background-color: #FFF;
    font-size: 28px;
    box-sizing: border-box;
  }
}
</style>
